Complex Filtering Question - iterating through attributes to compare them

I have an Excel document that I've brought into DOORS to manage the requirements contained within it. The Excel Document is split into two halves (it's actually an import of an XML file that our customer provides to us and we must use this document in this format).

THe top half of the document contains a list of categories, a list of Reference ID's and a boolean value to determine if the reference ID is valid in that specific category.

Example:
Category ReferenceID Applicable
CatI 1234 TRUE
CatI 2345 TRUE
CatII 1234 FALSE
CatII 2345 FALSE

And so on..
The bottom half of the document contains all of the reference ID's and all of the relevant requirement information

What I want to do is create a filter such that I get a list of all the reference ID's that apply to a specific category, and then use that list of ID's to grab the actual requirement information that is applicable to the category. In the second half of the document, the column that contains the reference ID's is the "Object Header" for DOORS. If this were a SQL statement, It'd be something like:

SELECT <relevant columns> WHERE ReferenceID==ObjectHEader AND (Category=="CatI" AND Applicable=="TRUE")

I am able to get the filter that does the filter that does "Category=="CatI" AND Applicable=="TRUE" It will return the list of ReferenceID's I need to get the remainder of the details on. I can't figure out how to get the second part of the filter done.

Any help would be appreciated!

Thanks!
rfischman - Tue Sep 06 07:07:11 EDT 2011

Re: Complex Filtering Question - iterating through attributes to compare them
OurGuest - Tue Sep 06 07:32:00 EDT 2011

As long as you don't have to save the filter in the view, the easiest filter to create is using:
accept(object)
and
reject(object)

See the help file.

Re: Complex Filtering Question - iterating through attributes to compare them
rfischman - Tue Sep 06 07:41:45 EDT 2011

OurGuest - Tue Sep 06 07:32:00 EDT 2011
As long as you don't have to save the filter in the view, the easiest filter to create is using:
accept(object)
and
reject(object)

See the help file.

The only thing I need the view to show is the final list of requirements after doing all the filtering. I don't need to save the intermediate filters as they're likely to change based on the aspect we need to address (e.g., we might need Cat I for one part, but Cat II for another, etc..)

Being relatively new to DXL, I'm not sure I understand how accept/reject will help?

Would I be doing something like using for loops to iterate through the objects to find the ones I need and then mark them as "accept" using the accept/reject functions? Would this then result in my view only having the objects that are needed.

Right now, my DXL code has the Filter functions being used to create the filtered list of reference ID's. And now I"m trying to figure out how to take that list of ID's and stick them in an array or Skip List, turn off the filtering and then iterate through the objects to find the ones I need.

Thanks again

Re: Complex Filtering Question - iterating through attributes to compare them
rfischman - Tue Sep 06 07:41:46 EDT 2011

OurGuest - Tue Sep 06 07:32:00 EDT 2011
As long as you don't have to save the filter in the view, the easiest filter to create is using:
accept(object)
and
reject(object)

See the help file.

The only thing I need the view to show is the final list of requirements after doing all the filtering. I don't need to save the intermediate filters as they're likely to change based on the aspect we need to address (e.g., we might need Cat I for one part, but Cat II for another, etc..)

Being relatively new to DXL, I'm not sure I understand how accept/reject will help?

Would I be doing something like using for loops to iterate through the objects to find the ones I need and then mark them as "accept" using the accept/reject functions? Would this then result in my view only having the objects that are needed.

Right now, my DXL code has the Filter functions being used to create the filtered list of reference ID's. And now I"m trying to figure out how to take that list of ID's and stick them in an array or Skip List, turn off the filtering and then iterate through the objects to find the ones I need.

Thanks again

Re: Complex Filtering Question - iterating through attributes to compare them
OurGuest - Tue Sep 06 07:58:51 EDT 2011

See simple demo as follows:

{code}
//ExampleFilter
/*Demo */
Module m=current
Object o
string s
load view "Standard view"
for o in m do
{ s=o."Applicable" ""
reject o
if(s=="TRUE") accept o
}
filtering on

Re: Complex Filtering Question - iterating through attributes to compare them
OurGuest - Tue Sep 06 08:03:36 EDT 2011

OurGuest - Tue Sep 06 07:58:51 EDT 2011
See simple demo as follows:

{code}
//ExampleFilter
/*Demo */
Module m=current
Object o
string s
load view "Standard view"
for o in m do
{ s=o."Applicable" ""
reject o
if(s=="TRUE") accept o
}
filtering on

See simple demo as follows:
 

//ExampleFilter
/*Demo */
Module m=current
Object o
string s
load view "Standard view"
for o in m do
{ s=o."Applicable" ""
  reject o
  if(s=="TRUE") accept o
}
filtering on

Re: Complex Filtering Question - iterating through attributes to compare them
rfischman - Tue Sep 06 11:29:35 EDT 2011

OurGuest - Tue Sep 06 08:03:36 EDT 2011

See simple demo as follows:
 

//ExampleFilter
/*Demo */
Module m=current
Object o
string s
load view "Standard view"
for o in m do
{ s=o."Applicable" ""
  reject o
  if(s=="TRUE") accept o
}
filtering on

Thanks!! This worked great. Now I have one more follow on question:

I created a form (call it Form1) to simplify some data entry for what we need to do.

After the filtering has been applied, is there a way I can force this form to be displayed to the user? I can't seem to find a reference to the forms in the DXL Reference guide.

Thanks again!

Re: Complex Filtering Question - iterating through attributes to compare them
OurGuest - Tue Sep 06 12:34:43 EDT 2011

rfischman - Tue Sep 06 11:29:35 EDT 2011
Thanks!! This worked great. Now I have one more follow on question:

I created a form (call it Form1) to simplify some data entry for what we need to do.

After the filtering has been applied, is there a way I can force this form to be displayed to the user? I can't seem to find a reference to the forms in the DXL Reference guide.

Thanks again!

I assume you are talking about dialog boxes in dxl

Re: Complex Filtering Question - iterating through attributes to compare them
rfischman - Tue Sep 06 12:42:57 EDT 2011

OurGuest - Tue Sep 06 12:34:43 EDT 2011
I assume you are talking about dialog boxes in dxl

I don't think so.. I created a Form using the Tools --> Forms --> New Form menu.

If I seect Tools --> Forms --> Run Form, I can choose to run the form that I have already created. It runs this form against my filtered set of objects. What I want to do, if possible is:

A) Have user select category to apply (I got this working already using the DBE and DB functions)
B) Apply the filter (Works now thanks to your sample code)
C) Run the form (Named Form1) against the filtered list of objects

Thanks